package com.framework.modules.live.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.Query;

import com.framework.modules.live.dao.LiveSnapshotDao;
import com.framework.modules.live.entity.LiveSnapshotEntity;
import com.framework.modules.live.service.LiveSnapshotService;


@Service("liveSnapshotService")
public class LiveSnapshotServiceImpl extends ServiceImpl<LiveSnapshotDao, LiveSnapshotEntity> implements LiveSnapshotService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<LiveSnapshotEntity> page = this.selectPage(
                new Query<LiveSnapshotEntity>(params).getPage(),
                new EntityWrapper<LiveSnapshotEntity>()
                        .eq(params.containsKey("stream_id"),"stream_id",params.getOrDefault("stream_id","0"))
        );

        return new PageUtils(page);
    }

}
